#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
/*
 * Copyright © 2014, Finium Sdn Bhd, All Rights Reserved
 * 
 * ThreadLocalRedis.java
 * Modification History
 * *************************************************************
 * Date				Author			Comment
 * Nov 28, 2013			Alvin Leong Chee Foo			Created
 * *************************************************************
 */
package ${package}.test;

import java.util.List;

/**
 * @author Alvin Leong Chee Foo
 * 
 */
public class ThreadLocalRedis
{
    private static final ThreadLocal<List<byte[]>> THREAD_LOCAL_REDIS_LIST_BYTES = new ThreadLocal<List<byte[]>>();
    private static final ThreadLocal<byte[]> THREAD_LOCAL_REDIS_BYTES = new ThreadLocal<byte[]>();

    /**
     * set redis data object
     * 
     * @param redisData
     */
    public static void setList(List<byte[]> redisData)
    {
        THREAD_LOCAL_REDIS_LIST_BYTES.set(redisData);
    }

    /**
     * remove a particular redis data object from the thread local data.
     */
    public static void unsetList()
    {
        THREAD_LOCAL_REDIS_LIST_BYTES.remove();
    }

    /**
     * get redis data object for the current executing thread.
     * 
     * @return redisData object
     */
    public static List<byte[]> getList()
    {
        return THREAD_LOCAL_REDIS_LIST_BYTES.get();
    }

    /**
     * set redis data object
     * 
     * @param redisData
     */
    public static void setBytes(byte[] redisData)
    {
        THREAD_LOCAL_REDIS_BYTES.set(redisData);
    }

    /**
     * remove a particular redis data object from the thread local data.
     */
    public static void unsetBytes()
    {
        THREAD_LOCAL_REDIS_BYTES.remove();
    }

    /**
     * get redis data object for the current executing thread.
     * 
     * @return redisData object
     */
    public static byte[] getBytes()
    {
        return THREAD_LOCAL_REDIS_BYTES.get();
    }

    /**
     * Constructor. Private to prevent unnecessary instantiation.
     */
    private ThreadLocalRedis()
    {
    }
}
